<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%option explicit%>
<%
Dim RZ_IN
RZ_IN=1
%>
<!--#include file="../conn.inc.asp" -->
<!--#include file="admin_inc/admin.function.asp" -->
<!--#include file="admin_inc/admin.sqlfunction.asp" -->
<!-- #include file="fckeditor.asp" -->
<%
checkadmin(4)
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改分类</title>
<link type="text/css" href="style/style.css" rel="stylesheet" rev="stylesheet"/>
<script type="text/javascript" src="admin_js/common.js"></script>
</head>
<body>
<%
dim id,rst,sqlt,name,engname,parentid,url,theorder,visible,fenlei,typeimg,content_chn,content_eng,template, template_pre,recordtemplate_pre,recordtemplate, perpage,keyword_chn,keyword_eng,typepath
id=GetIntQueryString("id")
set rst = Server.CreateObject("ADODB.Recordset")
sqlt = "select * from [c_type] where id="&id
rst.open sqlt,conn,1,1
if rst.eof or rst.bof then 
response.redirect("showmsg.asp?from=type_list.asp&msg=NoRecord")
else
name=rst("name")
engname=rst("engname")
parentid=rst("parentid")
url=rst("url")
theorder=rst("theorder")
visible=rst("visible")
fenlei=rst("fenlei")
typeimg=rst("typeimg")
content_chn=rst("content_chn")
content_eng=rst("content_eng")
template=rst("template")
recordtemplate=rst("recordtemplate")
perpage=rst("perpage")
keyword_chn=rst("keyword_chn")
keyword_eng=rst("keyword_eng")
typepath=rst("path")
end if 
rst.close
set rst=Nothing 

If IsNull(perpage) Or perpage="" Then perpage=20

Dim ftype,typepre
Select Case fenlei
	Case 1:
		template_pre="articlelist"
		recordtemplate_pre="articleshow"
		ftype="文章资讯"
		typepre=RZ_PRE_ARTICLE_LIST
	Case 2:
		template_pre="productlist"
		recordtemplate_pre="productshow"
		ftype="商品资讯"
		typepre=RZ_PRE_PRODUCT_LIST
	Case 3:
		template_pre="photolist"
		recordtemplate_pre="photoshow"
		ftype="图片资讯"
		typepre=RZ_PRE_PHOTO_LIST
	Case 5:
		template_pre="guestbooklist"
		recordtemplate_pre="guestbookshow"
		ftype="留言本"
		typepre=RZ_PRE_GUESTBOOK_LIST
	Case 6:
		ftype="单页分类"
		template_pre="typeshow"
		typepre=RZ_PRE_TYPE_SHOW
	Case 7:
		ftype="招聘信息"
		template_pre="joblist"
		recordtemplate_pre="jobshow"
		typepre=RZ_PRE_JOB_LIST
End Select 
%>
<table  cellspacing="0" cellpadding="0" class="table_800">
 <form name="rzform" method="post" action="type_save.asp">
<input type="hidden" name="act" value="modifysave"/>	
<input type="hidden" name="oldname" value="<%=name%>"/>	
<input type="hidden" name="oldengname" value="<%=engname%>"/>	
<input type="hidden" name="id" value="<%=id%>"/>
<tr>
	<th colspan="2">修改分类：<%=ftype%></th>
</tr>
<tr class="row">
	<td>分类名称</td>
	<td><input type="text" id="name" name="name" size="20" value="<%=name%>"/>名称请不要带半角逗号（,）</td>
</tr>
<tr class="row">
	<td>Class Name</td>
	<td><input type="text" id="engname" name="engname" size="20"  value="<%=engname%>" maxlength="100"/>名称请不要带半角逗号（,）</td>
</tr>
<%If fenlei<>"4" Then %>
<tr class="row">
	<td>前台访问地址</td>
	<td>
<%
Dim fdymic,fstatic
fdymic=GetPath("?"&typepre&"0-t"&CutPath(typepath)&".html")
fstatic=GetPath(RZ_HTML_PATH&"/"&typepre&"0/t"&Replace(CutPath(typepath),",","-")&".html")
%>
动态地址： <a href="<%=fdymic%>" target="_blank"><%=fdymic%></a>&nbsp;&nbsp;静态地址： <a href="<%=fstatic%>" target="_blank"><%=fstatic%></a>    （需先生成静态HTML）
<br/>说明：前缀后面的0表示中文，如果是英文，请改为1。
<br/>在模板中可以使用  @{cat.<%=id%>}  来直接得到分类地址。例如：&lt;a href=&quot;@{cat.<%=id%>}&quot;&gt;<%=name%>&lt;/a&gt;
	</td>
</tr>
<%End if%>
<tr class="row">
	<td>关键字</td>
	<td><input type="text" name="keyword_chn" id="keyword_chn" size="30" value="<%=keyword_chn%>" maxlength="100"/>使用空格分隔</td>
</tr>
<tr class="row">
	<td>Keyword</td>
	<td><input type="text" name="keyword_eng" id="keyword_eng" size="30" value="<%=keyword_eng%>"/>使用空格分隔</td>
</tr>
<input type="hidden" name="fenlei" id="fenlei" value="<%=fenlei%>">
<tr class="row">
	<td>排序</td>
	<td><input type="text" id="theorder" name="theorder" size="2" value="<%=theorder%>" onkeyup="this.value=this.value.replace(/[^\d]+?/g,'')"/>如果需要排序，请填写数字，否则请留空</td>
</tr>
<%If fenlei<>4 And fenlei<>6 Then %>
<tr class="row">
	<td>每页记录数</td>
	<td><input type="text" name="perpage" id="perpage" size="2" value="<%=perpage%>" onkeyup="this.value=this.value.replace(/[^\d]+?/g,'')" value="20"/><span style="color:red;">主列表页面请使用pagesize="x"来获取此参数值</span></td>
</tr>
<%End If %>
<%If fenlei=4  Then %>
<tr class="row">
	<td>前台链接地址</td>
	<td><input type="text" name="url" id="url" size="30" value="<%=url%>"/></td>
</tr>
<%End If %>
<tr class="row">
	<td>是否显示</td>
	<td><input type="checkbox" id="visible" name="visible" value="1" <%If visible=1 then%>checked="true"<%End If %>/>（如果不选中，则不会显示本分类）</td>
</tr>
<%If template_pre<>"" Then %>
<tr class="row">
	<td>栏目模板</td>
	<td>
	<select name="template" id="template">
	<%=ReadTemplateList(template_pre,template)%>
	</select><a href="manage_template.asp" onclick="alert('注意文件名要使用<%=template_pre%>_开头');">新建模板</a>
	</td>
</tr>
<%End If %>
<%If recordtemplate_pre<>"" Then %>
<tr class="row">
	<td>明细记录模板</td>
	<td>
	<select name="recordtemplate" id="recordtemplate">
	<%=ReadTemplateList(recordtemplate_pre,recordtemplate)%>
	<option value="" <%If recordtemplate="" then%>selected<%End if%>>不需要明细记录</option>
	</select><a href="manage_template.asp" onclick="alert('注意文件名要使用<%=template_pre%>_开头');">新建模板</a>
	</td>
</tr>
<%End If %>
<tr class="row">
<td>分类图片</td>
<td>
<input type="text" name="typeimg"  style="background-color:#CCCCCC;" id="typeimg" size="30" value="<%=typeimg%>"/><input type="button" name="copyimg" value="从已上传的图片中选择" onclick="openWin('selectphoto.asp?photobox=typeimg',840,500);"/><br/>
<iframe marginwidth="0" marginheight="0" frameborder="0" style="width:400px;height:30px" src="rzupload.asp?parentform=rzform&inputname=typeimg" scrolling="no"></iframe>
</td>
</tr>
<%If fenlei=1 Or fenlei=2 Or fenlei=3 Or fenlei=6 Then %>
<tr class="row">
	<td>中文内容</td>
	<td>
<%
Dim sBasePath
sBasePath = Request.ServerVariables("PATH_INFO")
sBasePath = Left( sBasePath, InStrRev( sBasePath, "/" ) )

Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath	= sBasePath
oFCKeditor.Config("ImageBrowser") = "true" 
oFCKeditor.Value	= content_chn
oFCKeditor.Create "content_chn"
%>
	</td>
</tr>
<tr class="row">
	<td>英文内容</td>
	<td>
<%
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath	= sBasePath
oFCKeditor.Config("ImageBrowser") = "true" 
oFCKeditor.Value	= content_eng
oFCKeditor.Create "content_eng"
%>
	</td>
</tr>
<%End If %>
<tr class="row">
	<td colspan="2" align="center"><input type="button" class="btn" value="保存" onclick="checkForm('addtype');">&nbsp;&nbsp;<input type="button" class="btn"  value="返回" onclick="javascript:location.href='type_list.asp'"/></td>
</tr> 
</form>
</table>
</table>
</body>
</html>